package test;

import java.util.Random;

/**
 * @author chihb
 * @create-time 2024/6/20 11:07
 * @description
 */
public class getRedPage {
    public static void main(String[] args) {
        f(new int[]{9, 666, 188, 520, 99999});
    }

    private static void f(int[] array) {
        Random r = new Random();
        int index;
        while (true) {
            index = r.nextInt(array.length);
            int money=array[index];
            if(money!=0){
                System.out.println(money);
                array[index]=0;
            }
        }
    }
}
